<template>
  <input class="myipt" @input="handlerinput" :value="value" />
</template>

<script>
export default {
  // 如果你设置了props属性，那么就会优先为这个属性赋值
  props: {
    value: "",
  },
  mounted() {
    console.log(this.value);
  },
  methods: {
    handlerinput(e) {
      let value = e.target.value;
      // 事件类型一定要叫input
      this.$emit("input", value);
    },
  },
};
</script>

<style lang="less" scoped>
.myipt {
  width: 318/360 * 100vw;
  height: 60px;
  outline: none;
  border: none;
  border-bottom: 3px solid #ccc;
  font-size: 20px;
  line-height: 60px;
}
</style>